public class Student {
    private String name = "lisi";
    private int age = 12;
    private static String room = "四班";

    //实例代码块 1
    {
        System.out.println("实例代码块 1 执行了");
    }

    //实例代码块 2
    {
        System.out.println("实例代码块 2 执行了");
    }

    //静态代码块 1
    static {
        System.out.println("静态代码块 1 执行了");
    }

    //静态代码块 2
    static {
        room = "三班";
        System.out.println("静态代码块 2 执行了");
    }

    //构造方法
    public Student(String name,int age) {
        this.name = name;
        this.age = age;
        System.out.println("构造方法执行了");
    }

    public String getName() {
       return name;
    }

    public int getAge() {
        return age;
    }

    public static String getRoom() {
        return room;
    }

}
